﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MenuItems_old.aspx.cs" Inherits="GPSTrackingWebsiteManager.Manager.Pages.MenuItems_old" %>

<!DOCTYPE html>

<link href="../../Css/GPSTrackingWebsite.css" rel="stylesheet" />
<link href="../../Css/messi.css" rel="stylesheet" />
<script src="../../Javascript/jquery-1.9.1.min.js"></script>
<script src="../../Javascript/messi.js"></script>
<script src="../../Javascript/Custom.js"></script>
<script src="../../Javascript/WindowMessageManager.js"></script>

<html xmlns="http://www.w3.org/1999/xhtml">
<telerik:RadScriptBlock ID="RadScriptBlock3" runat="server">
    <script type="text/javascript">

        function resizeGrid() {
            var height = (window.innerHeight) - 25;
            var tableView = $find("<%=MenuGrid.ClientID %>");
            tableView.get_element().style.height = (height) / 2 + "px";

            var tableView2 = $find("<%=MenuItemsGrid.ClientID %>");
            tableView2.get_element().style.height = (height - (height) / 2) + "px";

            document.getElementById('HiddenFieldHeight').value = (height);
        }

        //Windows Message Manager 
        var objWindowsMessageManager = new WindowsMessageManager();

    </script>
</telerik:RadScriptBlock>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"></telerik:RadCodeBlock>
<head runat="server">
    <title>Administración de Pantallas</title>
</head>
<body onresize="resizeGrid()" style="overflow: hidden">
    <form id="form1" runat="server">
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server"></telerik:RadWindowManager>       
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>        
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="MenuGrid">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rmpMenuItems" LoadingPanelID="RadAjaxLoadingPanel1" UpdatePanelCssClass="" />
                        <telerik:AjaxUpdatedControl ControlID="HiddenFieldError" /> 
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="MenuItemsGrid">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="MenuItemsGrid" LoadingPanelID="RadAjaxLoadingPanel1" UpdatePanelCssClass="" />
                        <telerik:AjaxUpdatedControl ControlID="HiddenFieldError" /> 
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"></telerik:RadAjaxLoadingPanel>
        <asp:HiddenField ID="HiddenFieldHeight" runat="server" Value="323" />
        <asp:HiddenField ID="HiddenFieldError" runat="server" Value="" />

        <telerik:RadTabStrip ID="rtsMenuItems" runat="server" SelectedIndex="0" MultiPageID="rmpMenuItems" ></telerik:RadTabStrip>
        <telerik:RadMultiPage ID="rmpMenuItems" runat="server" SelectedIndex="0">
        <telerik:RadPageView ID="rpvMenuItems" runat="server">

                <telerik:RadGrid ID="MenuGrid" runat="server" AutoGenerateColumns="False" CellSpacing="0" GridLines="None" Height="200px" Width="100%" OnDeleteCommand="MenuGrid_DeleteCommand" OnInsertCommand="MenuGrid_InsertCommand" OnNeedDataSource="MenuGrid_NeedDataSource" OnUpdateCommand="MenuGrid_UpdateCommand" AllowFilteringByColumn="False" OnSelectedIndexChanged="MenuGrid_SelectedIndexChanged" AllowSorting="true" GroupingSettings-CaseSensitive="false" OnItemCommand="MenuGrid_ItemCommand">
                    <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True">
                        </Scrolling>  <Selecting AllowRowSelect="True"></Selecting><ClientEvents OnPopUpShowing="PopUpShowing" />
                    </ClientSettings>
		        <MasterTableView EditMode="PopUp" EditFormSettings-PopUpSettings-Modal="true" EditFormSettings-CaptionFormatString="Modo Edición" CommandItemDisplay="TopAndBottom" NoMasterRecordsText="No hay registros" AllowFilteringByColumn="true" TableLayout="Auto">
                    <CommandItemTemplate>
                        <div style="padding: 5px 5px;"> Menu: 
                                <asp:LinkButton ID="lbAdd" runat="server" CommandName="InitInsert" Visible='<%# !MenuGrid.MasterTableView.IsItemInserted %>'><img style="padding-left:10px; padding-right:5px; vertical-align:middle" alt="" src="../../Template/Icons/16px/text-plus-icon.png"/>Nuevo Menu</asp:LinkButton>
                                <asp:LinkButton ID="lbClearMenuFilters" runat="server" OnClick="lbClearMenuFilters_Click"  Visible='<%# !MenuGrid.MasterTableView.IsItemInserted %>'><img style="padding-left:10px; padding-right:5px; vertical-align:middle" alt="" src="../../Template/Icons/16px/mixx-icon.png"/>Limpiar Filtros</asp:LinkButton>                                                                               
				<asp:LinkButton ID="lbShowError" runat="server" OnClick="lbShowError_Click" Visible='<%# HiddenFieldError.Value == string.Empty ? false : true %>'><img style="padding-left:10px; padding-right:5px; vertical-align:middle" alt="" src="../../Template/Icons/16px/bug-icon.png"/>Error Técnico</asp:LinkButton>                                                                                                               
                        </div>                        
                    </CommandItemTemplate>
                        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </RowIndicatorColumn>

                        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </ExpandCollapseColumn>

                        <Columns>
                            <telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderStyle-Width="25px" EditText="Editar" ItemStyle-Width="20px"/>
                            <telerik:GridButtonColumn HeaderStyle-Width="25px" ConfirmText="¿Desea eliminar el registro?" ConfirmDialogType="RadWindow" ConfirmDialogHeight="120" ConfirmDialogWidth="270" ConfirmTitle="Eliminar" ButtonType="ImageButton" CommandName="Delete" Text="Eliminar" ItemStyle-Width="20px" />
                            <telerik:GridBoundColumn DataField="ItemID" HeaderText="ItemID" UniqueName="ItemID" ForceExtractValue="Always" ReadOnly="true" Display="false" HeaderStyle-Width="200px" MaxLength="50" FilterControlWidth="180px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Description" HeaderText="Descripción Menu Principal" UniqueName="Description" HeaderStyle-Width="200px" MaxLength="50" FilterControlWidth="180px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Value" HeaderText="Opción Menu Principal" UniqueName="Value" HeaderStyle-Width="200px" MaxLength="50" FilterControlWidth="180px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ValueOwner"  HeaderText="Menu Padre" UniqueName="ValueOwner" ReadOnly="true" ForceExtractValue="Always" Display="false" HeaderStyle-Width="200px" MaxLength="50" FilterControlWidth="180px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
                            </telerik:GridBoundColumn>
                            <telerik:GridCheckBoxColumn DataField="IsUser" HeaderText="Usuarios" UniqueName="IsUser" CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="100px" AllowFiltering="false" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
                            </telerik:GridCheckBoxColumn>
                            <telerik:GridCheckBoxColumn DataField="IsAdmin" HeaderText="Administrador" UniqueName="IsAdmin" CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="100px" AllowFiltering="false" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
                            </telerik:GridCheckBoxColumn>
                            <telerik:GridCheckBoxColumn DataField="IsMaster" HeaderText="Master" UniqueName="IsMaster" CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="100px" AllowFiltering="false" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
                            </telerik:GridCheckBoxColumn>
                        </Columns>

                        <EditFormSettings>
                            <EditColumn InsertText="Agregar" UpdateText="Actualizar" CancelText="Cancelar" ButtonType="ImageButton"></EditColumn>
                        </EditFormSettings>

<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
                    </MasterTableView>

<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
                      <ClientSettings>
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True">
                        </Scrolling>
                    </ClientSettings>
                    <FilterMenu EnableImageSprites="False"></FilterMenu>
                </telerik:RadGrid>


                <br/>
                <telerik:RadGrid ID="MenuItemsGrid" runat="server" AutoGenerateColumns="False" CellSpacing="0" GridLines="None" Height="200px" Width="100%" OnDeleteCommand="MenuItemsGrid_DeleteCommand" OnInsertCommand="MenuItemsGrid_InsertCommand" OnNeedDataSource="MenuItemsGrid_NeedDataSource" OnUpdateCommand="MenuItemsGrid_UpdateCommand" AllowFilteringByColumn="true" AllowSorting="true">
		            <MasterTableView EditMode="PopUp" EditFormSettings-PopUpSettings-Modal="true" EditFormSettings-CaptionFormatString="Modo Edición" CommandItemDisplay="TopAndBottom" NoMasterRecordsText="No hay registros" AllowFilteringByColumn="true" TableLayout="Auto">
                    <CommandItemTemplate>
                        <div style="padding: 5px 5px;"> Menu: 
                                <asp:LinkButton ID="lbAdd" runat="server" CommandName="InitInsert" Visible='<%# !MenuItemsGrid.MasterTableView.IsItemInserted %>'><img style="padding-left:10px; padding-right:5px; vertical-align:middle" alt="" src="../../Template/Icons/16px/text-plus-icon.png"/>Nueva Opción</asp:LinkButton>
                                <asp:LinkButton ID="lbClearMenuItemsFilters" runat="server" OnClick="lbClearMenuItemsFilters_Click"  Visible='<%# !MenuItemsGrid.MasterTableView.IsItemInserted %>'><img style="padding-left:10px; padding-right:5px; vertical-align:middle" alt="" src="../../Template/Icons/16px/mixx-icon.png"/>Limpiar Filtros</asp:LinkButton>                                                                               
				                <asp:LinkButton ID="lbShowError" runat="server" OnClick="lbShowError_Click" Visible='<%# HiddenFieldError.Value == string.Empty ? false : true %>'><img style="padding-left:10px; padding-right:5px; vertical-align:middle" alt="" src="../../Template/Icons/16px/bug-icon.png"/>Error Técnico</asp:LinkButton>                                                                                                               
                        </div>                        
                    </CommandItemTemplate>

                        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </RowIndicatorColumn>

                        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </ExpandCollapseColumn>

                        <Columns>
                            <telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderStyle-Width="25px" EditText="Editar" ItemStyle-Width="20px"/>
                            <telerik:GridButtonColumn HeaderStyle-Width="25px" ConfirmText="¿Desea eliminar el registro?" ConfirmDialogType="RadWindow" ConfirmDialogHeight="120" ConfirmDialogWidth="270" ConfirmTitle="Eliminar" ButtonType="ImageButton" CommandName="Delete" Text="Eliminar" ItemStyle-Width="20px" />
                            <telerik:GridBoundColumn DataField="ItemID" HeaderText="ItemID" UniqueName="ItemID" ForceExtractValue="Always" ReadOnly="true" Display="false" HeaderStyle-Width="200px" MaxLength="50" FilterControlWidth="180px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Description" HeaderText="Descripción Pantalla" UniqueName="Description" HeaderStyle-Width="200px" MaxLength="50" FilterControlWidth="180px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Value" HeaderText="Opción Menu Pantalla" UniqueName="Value" HeaderStyle-Width="200px" MaxLength="50" FilterControlWidth="180px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ValueOwner" HeaderText="Menu Padre" UniqueName="ValueOwner" ReadOnly="true" ForceExtractValue="Always" Display="false" HeaderStyle-Width="200px" MaxLength="50" FilterControlWidth="180px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
                            </telerik:GridBoundColumn>
                            <telerik:GridCheckBoxColumn DataField="IsUser" HeaderText="Usuarios" UniqueName="IsUser" CurrentFilterFunction="Contains" ShowFilterIcon="false" AllowFiltering="false" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
                            </telerik:GridCheckBoxColumn>
                            <telerik:GridCheckBoxColumn DataField="IsAdmin" HeaderText="Administrador" UniqueName="IsAdmin" CurrentFilterFunction="Contains" ShowFilterIcon="false" AllowFiltering="false" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
                            </telerik:GridCheckBoxColumn>
                            <telerik:GridCheckBoxColumn DataField="IsMaster" HeaderText="Master" UniqueName="IsMaster" CurrentFilterFunction="Contains" ShowFilterIcon="false" AllowFiltering="false" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
                            </telerik:GridCheckBoxColumn>
                        </Columns>

                        <EditFormSettings>
                            <EditColumn InsertText="Agregar" UpdateText="Actualizar" CancelText="Cancelar" ButtonType="ImageButton"></EditColumn>
                        </EditFormSettings>

<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
                    </MasterTableView>

<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
                    <ClientSettings EnableRowHoverStyle="true">
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True">
                        </Scrolling>  <Selecting AllowRowSelect="True"></Selecting><ClientEvents OnPopUpShowing="PopUpShowing" />
                    </ClientSettings>
                    <FilterMenu EnableImageSprites="False"></FilterMenu>
                </telerik:RadGrid>

        </telerik:RadPageView>
        </telerik:RadMultiPage>

    </form>
</body>
</html>
